﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Zwms.Client.CommonUI;

namespace Zwms.Client
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            SplashScreen.Instance.Font = new System.Drawing.Font("宋体", 11.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

            // begin displaying the splash screen before running the application form
            SplashScreen.SetBackgroundImage(Zwms.Client.Properties.Resources.splash);
            SplashScreen.SetTitleString("Please Wait...");

            ServiceReferenceZwms.ServiceZwmsClient client =
                new ServiceReferenceZwms.ServiceZwmsClient();
            //try
            //{
            //    string str = client.GetAuthorityString();
            //    if (str != "1a11003a49730a0d")
            //    {
            //        MessageBox.Show("服务器端未授权！");
            //        return;
            //    }
            //}
            //catch
            //{
            //    MessageBox.Show("服务器端未授权！");
            //    return;
            //}
            
            LoginForm window = new LoginForm();
            if (window.ShowDialog() == DialogResult.OK)
            {
                Application.Run(new MainForm());
            }
        }
    }
}
